export const DPI = window.devicePixelRatio || 1;
export const S10 = 10 * DPI;
export const S5 = S10 / 2;
export const getYSpace = (datasets, yEqual) => {
  let arr = datasets.map(item => {
    return item.data.reduce((prev, current) => {
      return prev > current ? prev : current;
    });
  });
  let len = Math.ceil(Math.max(...arr) / yEqual);
  let pow = len.toString().length - 1;
  pow = pow > 2 ? 2 : pow;
  return Math.ceil(len / Math.pow(10, pow)) * Math.pow(10, pow);
};
